// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ICloudQueueClient.cs" company="AzureContrib (Open source library http://azurecontrib.codeplex.com)">
//   Microsoft Public License (Ms-PL)
// </copyright>
// <summary>
//   Exception for errors when handling Windows Azure Cloud Drives.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.Collections.Generic;

using Microsoft.WindowsAzure.StorageClient;

namespace AzureContrib.WindowsAzure.StorageClient
{
	/// <summary>
	/// Contract for a Microsoft.WindowsAzure.StorageClient.CloudQueueClient
	/// </summary>
	public interface ICloudQueueClient
	{
		/// <summary>
		/// Subscribes to the wrapped Microsoft.WindowsAzure.StorageClient.CloudQueueClient.ResponseReceived
		/// </summary>
		event EventHandler<ResponseReceivedEventArgs> ResponseReceived;

		/// <summary>
		/// Gets or sets a RetryPolicy.
		/// </summary>
		RetryPolicy RetryPolicy { get; set; }

		/// <summary>
		/// Gets or sets a Timeout.
		/// </summary>
		TimeSpan Timeout { get; set; }

		/// <summary>
		/// Gets a value indicating whether to UsePathStyleUris.
		/// </summary>
		bool UsePathStyleUris { get; }

		/// <summary>
		/// Gets Credentials.
		/// </summary>
		IStorageCredentials Credentials { get; }

		/// <summary>
		/// Calls the wrapped GetQueueReference.
		/// </summary>
		/// <param name="queueAddress">
		/// The queue Address.
		/// </param>
		/// <returns>
		/// The get queue reference.
		/// </returns>
		ICloudQueue GetQueueReference(string queueAddress);

		/// <summary>
		/// Calls the wrapped ListQueues().
		/// </summary>
		/// <returns>
		/// The list queues.
		/// </returns>
		IEnumerable<ICloudQueue> ListQueues();

		/// <summary>
		/// Calls the wrapped ListQueues(string)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <returns>
		/// The list queues.
		/// </returns>
		IEnumerable<ICloudQueue> ListQueues(string prefix);

		/// <summary>
		/// Calls the wrapped ListQueues(string,QueueListingDetails)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="detailsIncluded">
		/// The details Included.
		/// </param>
		/// <returns>
		/// The list queues.
		/// </returns>
		IEnumerable<ICloudQueue> ListQueues(string prefix, QueueListingDetails detailsIncluded);

		/// <summary>
		/// Calls the wrapped ListQueuesSegmented()
		/// </summary>
		/// <returns>
		/// The list queues segmented.
		/// </returns>
		IResultSegment<ICloudQueue> ListQueuesSegmented();

		/// <summary>
		/// Calls the wrapped ListQueuesSegmented(string,QueueListingDetails)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="detailsIncluded">
		/// The details Included.
		/// </param>
		/// <returns>
		/// The list queues segmented.
		/// </returns>
		IResultSegment<ICloudQueue> ListQueuesSegmented(string prefix, QueueListingDetails detailsIncluded);

		/// <summary>
		/// Calls the wrapped ListQueuesSegmented(string,QueueListingDetails,int,ResultContinuation)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="detailsIncluded">
		/// The details Included.
		/// </param>
		/// <param name="maxResults">
		/// The max Results.
		/// </param>
		/// <param name="continuationToken">
		/// The continuation Token.
		/// </param>
		/// <returns>
		/// The list queues segmented.
		/// </returns>
		IResultSegment<ICloudQueue> ListQueuesSegmented(string prefix, QueueListingDetails detailsIncluded, int maxResults, ResultContinuation continuationToken);

		/// <summary>
		/// Calls the wrapped BeginListQueuesSegmented(AsyncCallback,object)
		/// </summary>
		/// <param name="callback">
		/// The callback.
		/// </param>
		/// <param name="state">
		/// The state.
		/// </param>
		/// <returns>
		/// The begin list queues segmented.
		/// </returns>
		IAsyncResult BeginListQueuesSegmented(AsyncCallback callback, object state);

		/// <summary>
		/// Calls the wrapped BeginListQueuesSegmented(string,AsyncCallback,object)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="callback">
		/// The callback.
		/// </param>
		/// <param name="state">
		/// The state.
		/// </param>
		/// <returns>
		/// The begin list queues segmented.
		/// </returns>
		IAsyncResult BeginListQueuesSegmented(string prefix, AsyncCallback callback, object state);

		/// <summary>
		/// Calls the wrapped BeginListQueuesSegmented(string,QueueListingDetails,AsyncCallback,object)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="detailsIncluded">
		/// The details Included.
		/// </param>
		/// <param name="callback">
		/// The callback.
		/// </param>
		/// <param name="state">
		/// The state.
		/// </param>
		/// <returns>
		/// The begin list queues segmented.
		/// </returns>
		IAsyncResult BeginListQueuesSegmented(string prefix, QueueListingDetails detailsIncluded, AsyncCallback callback, object state);

		/// <summary>
		/// Calls the wrapped BeginListQueuesSegmented(string,QueueListingDetails,int,ResultContinuation,AsyncCallback,object)
		/// </summary>
		/// <param name="prefix">
		/// The prefix.
		/// </param>
		/// <param name="detailsIncluded">
		/// The details Included.
		/// </param>
		/// <param name="maxResults">
		/// The max Results.
		/// </param>
		/// <param name="continuationToken">
		/// The continuation Token.
		/// </param>
		/// <param name="callback">
		/// The callback.
		/// </param>
		/// <param name="state">
		/// The state.
		/// </param>
		/// <returns>
		/// The begin list queues segmented.
		/// </returns>
		IAsyncResult BeginListQueuesSegmented(string prefix, QueueListingDetails detailsIncluded, int maxResults, ResultContinuation continuationToken, AsyncCallback callback, object state);

		/// <summary>
		/// Calls the wrapped EndListQueuesSegmented
		/// </summary>
		/// <param name="asyncResult">
		/// The async Result.
		/// </param>
		/// <returns>
		/// The end list queues segmented.
		/// </returns>
		IResultSegment<ICloudQueue> EndListQueuesSegmented(IAsyncResult asyncResult);
	}
}